// pages/search/search.js
Page({
  data:{
    grade: true,
    subject: true,
    gradeDesc: '年级',
    subjectDesc: '学科',
  },
  gradeShow:function() {
      var grade = this.data.grade;
      console.log(grade);
      if (grade == true){
          this.setData({
              grade: false,
              subject: true,
          })
      }else {
          this.setData({
              grade: true,
          })
      }
  },
  subjectShow:function() {
      var subject = this.data.subject;
      console.log(subject);
      if (subject == true){
          this.setData({
              subject: false,
              grade: true,
          })
      }else {
          this.setData({
              subject: true,
          })
      }
  },
  mySelect1:function(e) {
      this.setData({
          gradeDesc: e.target.dataset.me,
          grade: true
      })
  },
  mySelect2:function(e) {
      this.setData({
          subjectDesc: e.target.dataset.subject,
          subject: true
      })
  },
  hideAll:function() {
      this.setData({
          subject: true,
          grade: true,
      })
  },
  onLoad:function(options){
    // 页面初始化 options为页面跳转所带来的参数
  },
  onReady:function(){
    // 页面渲染完成
  },
  onShow:function(){
    // 页面显示
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    // 页面关闭
  }
})